/*
 * @Author: szx
 * @Date: 2022-05-12 13:21:02
 * @LastEditTime: 2022-05-12 13:30:25
 * @Description:
 * @FilePath: \leetcode\900-999\944\944.js
 */
/**
 * @param {string[]} strs
 * @return {number}
 */
var minDeletionSize = function (strs) {
    const n = strs.length,
        m = strs[0].length;
    let res = 0;
    for (let i = 0; i < m; i++) {
        for (let j = 1; j < n; j++) {
            if (strs[j][i].charCodeAt() < strs[j - 1][i].charCodeAt()) {
                res++;
                break;
            }
        }
    }
    return res;
};
